﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="testBPA.aspx.cs" Inherits="testBPA" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<%@ Register assembly="Microsoft.ReportViewer.WebForms, Version=9.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" namespace="Microsoft.Reporting.WebForms" tagprefix="rsweb" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
      <title>Calendar Extender</title>
      <script type="text/javascript">
      function checkDate(sender,args)
{
if (sender._selectedDate > new Date())
                  {
                        alert("You cannot select a day greater than today!");
                        sender._selectedDate = new Date();
                        // set the date back to the current date
sender._textbox.set_Value(sender._selectedDate.format(sender._format))
                  }
}
      </script>
</head><body>
Call the code:
   <form id="form1" runat="server">
            <asp:ScriptManager ID="ScriptManager1" runat="server" />
            <div>
              
                  <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                  <cc1:CalendarExtender ID="CalendarExtender1"
                  runat="server" OnClientDateSelectionChanged="checkDate" TargetControlID="TextBox1" />

                  <br />
                  <br />
                  <rsweb:ReportViewer ID="ReportViewer1" runat="server" Font-Names="Verdana" 
                      Font-Size="8pt" Height="400px" Width="400px">
                      <LocalReport ReportPath="Reprts\StockManagement\Report.rdlc">
                          <DataSources>
                              <rsweb:ReportDataSource DataSourceId="ObjectDataSource1" 
                                  Name="EBBusinessProcessAutomationDataSet_ProductList" />
                          </DataSources>
                      </LocalReport>
                  </rsweb:ReportViewer>
                  <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" 
                      SelectMethod="GetData" 
                      TypeName="EBBusinessProcessAutomationDataSetTableAdapters.ProductListTableAdapter">
                  </asp:ObjectDataSource>

            </div>
      </form></body>
</html>
